]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
screencast: Fix return value in case of invalid file template
authorFlorian Müllner <fmuellner@gnome.org>
Wed, 22 May 2013 14:42:00 +0000 (16:42 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Wed, 22 May 2013 15:22:28 +0000 (17:22 +0200)
If we are passed an invalid file template, ShellRecorder.record()
will return a %NULL filename; as the Screencast DBus interface
expects a string return value, we cannot return the value unmodified
in that case.

https://bugzilla.gnome.org/show_bug.cgi?id=700842

js/ui/screencast.js

index 642d40ac6c473afeada0124d547430f4d1117c58..4a14933cc3604d206590ce90b191ed10c418de0b 100644 (file)
@@ -105,7 +105,8 @@ const ScreencastService = new Lang.Class({
 
             recorder.set_file_template(fileTemplate);
             this._applyOptionalParameters(recorder, options);
-            returnValue = recorder.record();
+            let [success, fileName] = recorder.record();
+            returnValue = [success, fileName ? fileName : ''];
         }
 
         invocation.return_value(GLib.Variant.new('(bs)', returnValue));
@@ -125,7 +126,8 @@ const ScreencastService = new Lang.Class({
             recorder.set_file_template(fileTemplate);
             recorder.set_area(x, y, width, height);
             this._applyOptionalParameters(recorder, options);
-            returnValue = recorder.record();
+            let [success, fileName] = recorder.record();
+            returnValue = [success, fileName ? fileName : ''];
         }
 
         invocation.return_value(GLib.Variant.new('(bs)', returnValue));